<form class="layui-form layui-form-pane" lay-filter="FormSysGroupAdd" action="/sys/group/limit">
    <input type="hidden" id="gid" name="gid" th:value="${sysGroup.id}">
    <input type="hidden" id="limits" name="limits" value="">
    <div class="layui-row p-l-sm m-b-xl">
        <div class="layui-row">
            <div id="permissionTree"></div>
        </div>
    </div>
</form>
<script th:inline="javascript">
    /*<![CDATA[*/
    treeData = [];
    /*[# th:each="item,itemStat:${sysModels}"]*/
    modelData = {
        id: "M-" + [[${item.id}]],
        title: [[${item.modelName}]],
        field: 'model',
        spread: true,
        checked: true,
        children: [[${@lj.resTree(modelResource[item.id],"res")}]]
    };
    treeData.push(modelData);
    /*[/]*/
    /*]]>*/
</script>
<script>
    layui.use(["tree", 'form'], function () {
        let form = layui.form;
        let tree = layui.tree;
        form.render();
        tree.render({
            elem: '#permissionTree',
            data: treeData,
            showCheckbox: true,
            id: 'groupLimit'
        });
    });
</script>